package com.aplink.generic;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;

public abstract class GenericActivity extends FragmentActivity {
    public static final int NONE = 0;
    private GenericFragment mGenericFragment;

    @Override
    protected void onCreate( Bundle savedInstanceState ) {
        super.onCreate( savedInstanceState );
        mGenericFragment = getFragment();
        FragmentManager fragmentManager = getSupportFragmentManager();
        FragmentTransaction fragmentTransaction = fragmentManager
                .beginTransaction();
        fragmentTransaction.replace( android.R.id.content, mGenericFragment );
        fragmentTransaction.commit();
    }

    protected abstract GenericFragment getFragment();
}
